package atom.ui 
{
	import atom.ui.View;
	import flash.events.Event;
	import flash.geom.Rectangle;
	
	/**
	 * Represents an abstract class for base components.
	 * @author Jorge Braccini
	 */
	public class Component extends ViewContainer {
		
		public function Component(init:Object = null) {
			super(init);
		}
		
		public function setSize(width:Number, height:Number):void {
			init.width = width;
			init.height = height;
			
			invalidate();
		}
		
		override protected function initValues():void {
			super.initValues();
			
			init.width 		= 100;
			init.height		= 100;
			init.margin		= 0;
		}
		
		/////////////////////////////////////////
		// Properties ///////////////////////////
		/////////////////////////////////////////
		
		override public function get width():Number { return init.width; }
		
		override public function get height():Number { return init.height; }
		
		override public function set width(value:Number):void {
			init.width = value;
			invalidate();
		}
		
		override public function set height(value:Number):void {
			init.height = value;
			invalidate();
		}
		
		public function get spriteWidth():Number { return super.width; }
		
		public function get spriteHeight():Number { return super.height; }
		
	}

}